RUN = docker-compose run app
init_data:
	# /bin/bash -l -c "mysql -uroot -p123456 -h127.0.0.1 fuxiong < ./db/fuxiong.sql"
start:
	@docker-compose up -d
status:
	@docker-compose ps
stop:
	@docker-compose stop
stop-all:
	@docker-compose down
reindex:
	@echo "Reindex ElasticSearch..."
	@docker-compose run app /bin/bash -l -c "bundle exec rake es:index_data"
build_one_cms:
	@docker build --no-cache -t registry.cn-zhangjiakou.aliyuncs.com/weiyatech/one_cms ./images/one_cms/.
	@docker	push registry.cn-zhangjiakou.aliyuncs.com/weiyatech/one_cms
deploy_one_cms:
	ssh weiya  "cd /var/www/docker_cms; git pull; docker-compose pull one_cms; docker-compose stop one_cms; docker-compose up -d one_cms;"
build_cms_web:
	@docker build --no-cache -t registry.cn-zhangjiakou.aliyuncs.com/weiyatech/cms_web ./images/cms_web/.
	@docker	push registry.cn-zhangjiakou.aliyuncs.com/weiyatech/cms_web
deploy_cms_web:
	ssh ubuntu@39.98.188.247 "cd /var/www/docker_cms; git pull; docker-compose pull cms_web; docker-compose stop cms_web; docker-compose up -d cms_web;"
build_cms_admin:
	@docker build --no-cache -t registry.cn-zhangjiakou.aliyuncs.com/weiyatech/cms_admin ./images/cms_admin/.
	@docker	push registry.cn-zhangjiakou.aliyuncs.com/weiyatech/cms_admin
deploy_cms_admin:
	ssh weiya  "cd /var/www/docker_cms; git pull; docker-compose pull cms_admin; docker-compose stop cms_admin; docker-compose up -d cms_admin;"
deploy:
	ssh weiya "cd /var/www/docker_cms; docker-compose pull; sh ./restart-app;"
